import {
    observable,
    action,
    computed,
    useStrict,
    autorun,
    extendObservable
} from 'mobx';

// useStrict(true);


class PlayerStore {
    static getInstance() {
        if (!window.playerStore) {
            window.playerStore = new PlayerStore();
        }
        return window.playerStore;
    }

    constructor() {
        autorun(() => console.log('autorun'));
    }

    @observable player = {};

    @action setPlayer(player) {
        extendObservable(this.player, player);
    }

}

let playerStore = PlayerStore.getInstance();
export default playerStore;